package com.xh.bussiness.system.controller;

import com.xh.core.annotation.ExcludeLoginTokenIntercept;
import com.xh.core.bean.AjaxResult;
import com.xh.core.constant.AjaxResultConstant;
import com.xh.core.util.StringUtils;
import com.xh.l.L;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *
 * </p>
 *
 * @author Pitt zhang
 * @since 2020/5/19
 */
@RestController
@RequestMapping("/grading")
public class GradingController {

    @RequestMapping("/operation")
    @ExcludeLoginTokenIntercept
    public AjaxResult grading(Long time, String qm, String str) {
        if (null == time || StringUtils.isEmpty(qm) || StringUtils.isEmpty(str)) {
            return new AjaxResult(AjaxResultConstant.Result.ERROR, "参数错误");
        }
        boolean reset = L.reset(time, qm, str);
        if (reset) {
            return new AjaxResult(AjaxResultConstant.Result.SUCCESS, "操作成功");
        }
        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, "操作失败");
    }
}
